package com.jxl.dnd.charactercreator.factories
{
	import com.jxl.dnd.charactercreator.vo.Character;
	import com.jxl.dnd.charactercreator.vo.CharacterSheetVO;
	
	public class CharacterSheetFactory
	{
		
		public static function getDefaultCharacter():Character
		{
			return new Character();
		}
		
		public static function getDefaultCharacterSheet():CharacterSheetVO
		{
			return new CharacterSheetVO();
		}
		
		public static function getCharacterSheet(characterSheetData:String):CharacterSheetVO
		{
			var charCode:Number = characterSheetData.charCodeAt(0);
			if(charCode == 1 || charCode == 6)
			{
				characterSheetData = characterSheetData.substring(2, characterSheetData.length);
			}
			var characterSheet:CharacterSheetVO = new CharacterSheetVO();
			characterSheet.buildFromXML(new XML(characterSheetData));
			return characterSheet;
		}

	}
}